<?php $this->load->view('common/header');?>
<body class="padding_top">
<!-- head [[-->
<div class="head_box">
	<div class="bank_nav">
        <a href="order.html"><i class="ico"></i></a>
    </div>
    <div class="head_title">确认订单</div>
</div>
<!--]] head -->
<!-- info [[-->
<div class="certified_form">
	<dl>
    	<dt>开票</dt>
        <dd>
        	<label class="is_kaipiao" type="1">
            	<i class="ico"></i>是（10%税点）
            </label>
        	<label class="on is_kaipiao" type="2">
            	<i class="ico"></i>否
            </label>
        </dd>
    </dl>
	<dl>
    	<dt>送货</dt>
        <dd>
        	<label class="is_songhuo" type="1">
            	<i class="ico"></i>是
            </label>
        	<label class="on is_songhuo" type="2">
            	<i class="ico"></i>否
            </label>
        </dd>
    </dl>
	<dl>
    	<dt>收货地址</dt>
        <dd>
        	<a href="<?php echo site_url('member/address/'.$order['order_no']) ?>" class="address"><?php echo $dress_city;?></a>
            <input type="hidden" id="dress_id" value="<?php echo $dress_id;?>" >
        </dd>
    </dl>
    <dl>
        <dt>交货日期</dt>
        <dd class="good_num_dd">
            <span class="input">
                    <input placeholder="请选择交货日期" class="good_date" id="good_date">
                </span>
        </dd>
    </dl>
	<dl>
    	<dt>备注</dt>
        <dd>
        	<span class="input">
            	<textarea id="remark" placeholder="请输入注意事项"></textarea>
            </span>
        </dd>
    </dl>
    <input type="hidden" id="order_no_hidden" name="order_no_hidden" value="<?php echo $order['order_no'];?>">
	<dl class="sure_nav">
    	<a href="javascript:;" id="go_order_pay">
            <input type="submit">
            下一步
        </a>
    </dl>
</div>
<?php echo admin_js_url('laydate');?>
<script>
    laydate.render({
        elem: '#good_date' //指定元素
    });
    $('.is_songhuo').click(function(){
        $(this).addClass("on").siblings().removeClass("on");
    });
    $('.is_kaipiao').click(function(){
        $(this).addClass("on").siblings().removeClass("on");
    });
    // 提交
    $("#go_order_pay").on("click",function(){
        var is_kaipiao=$('.is_kaipiao.on').attr('type');
        var is_songhuo=$('.is_songhuo.on').attr('type');
        var remark=$('#remark').val();
        var dress_id=$('#dress_id').val();
        var order_no = $("#order_no_hidden").val();
        var good_date = $("#good_date").val();
        var URL= baseurl+"index.php/order/order_pay";
        $.ajax({
            type: "post",
            url: URL,
            dataType:'json',
            data: {
                'order_no':order_no,
                'is_songhuo':is_songhuo,
                'is_kaipiao':is_kaipiao,
                'remark':remark,
                'dress_id':dress_id,
                'good_date':good_date,
                'csrf_test_name': ci_csrf_token()
            },
            success: function(data){
                if(data.status == 200){
                    window.location.href = data.url;
                }else{
                    layer.msg(data.msg);
                    return false;
                }

            }
        });
    });
</script>
<!--]] info -->
</body>
</html>
